<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文本</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/style.css}"/>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
</head>

<body>
<div class="place"><span>位置：</span>
    <ul class="placeul">
        <li>仓库管理</li>
        <li>出库管理</li>
        <li>基本内容</li>
    </ul>
</div>
<div class="rightinfo">
    <form th:action="@{/kcWarehouse/lists}" method="post" name="conditionForm">
        <ul class="tools">
            <li>仓库名称:
                <input type="text" name="cname" th:value="${cName}"/>
            </li>
            <li>商品品牌:
                <input type="text" name="brandNmae" th:value="${brandNmae}"/>
            </li>
            <li>商品类型:
                <input type="text" name="typeName" th:value="${typeName}"/>
            </li>
            <li>商品名称:
                <input type="text" name="proName" th:value="${proName}"/>
            </li>
            <li class="subBut" onclick="query()"><img th:src="@{/images/t06.png}"/>查询</li>
        </ul>
        <table class="tablelist">
            <thead>
            <tr>
                <th>序号</th>
                <th>仓库名称</th>
                <th>商品品牌</th>
                <th>商品类型</th>
                <th>商品名称</th>
                <th>厂商名称</th>
                <th>商品数量</th>
                <th>单位</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="kc,var:${pb.list}">
                <td th:text="${(pb.pageNum-1)*pb.pageSize+var.count}">1</td>
                <td th:text="${kc.warehouse.cName}">南京21号仓库</td>
                <td th:text="${kc.brand.brandName}">联想</td>
                <td th:text="${kc.cType.typeName}">笔记本</td>
                <td th:text="${kc.product.productModel}">X260i</td>
                <td th:text="${kc.cFirm.firmName}">北京联想科技股份有限公司</td>
                <td th:text="${kc.repertory}">100</td>
                <td>台</td>
            </tr>
            </tbody>
        </table>
        <div class="pagin">
            <div class="message">共<i class="blue" th:text="${pb.total}">1256</i>条记录，当前显示第&nbsp;<i class="blue"
                                                                                                  th:text="${pb.pageNum}">2&nbsp;</i>页
            </div>
            <ul class="paginList">
                <li class="paginItem">
                    <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${pb.isFirstPage?1:pb.pageNum-1}]])">
                        <span th:class="${pb.isFirstPage?'pagepre':'pagenxt roate'}"></span>
                    </a>
                </li>
                <li class="paginItem" th:if="${1+4<=pb.pageNum}"><a th:onclick="tiaoZhuan(1)"
                                                                    href="javascript:void(0);">1</a></li>
                <li class="paginItem more" th:if="${1+5<=pb.pageNum}"><a href="javascript:void(0);">...</a></li>
                <li class="paginItem" th:if="${1+3<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-3}]])"
                                                                    href="javascript:void(0);"
                                                                    th:text="${pb.pageNum-3}">3</a></li>
                <li class="paginItem" th:if="${1+2<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-2}]])"
                                                                    href="javascript:void(0);"
                                                                    th:text="${pb.pageNum-2}">4</a></li>
                <li class="paginItem" th:if="${1+1<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-1}]])"
                                                                    href="javascript:void(0);"
                                                                    th:text="${pb.pageNum-1}">1</a></li>
                <li class="paginItem current"><a href="javascript:void(0);" th:text="${pb.pageNum}">2</a></li>

                <li class="paginItem" th:if="${pb.pages-1>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+1}]])"
                                                                           href="javascript:void(0);"
                                                                           th:text="${pb.pageNum+1}">3</a></li>
                <li class="paginItem" th:if="${pb.pages-2>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+2}]])"
                                                                           href="javascript:void(0);"
                                                                           th:text="${pb.pageNum+2}">4</a></li>
                <li class="paginItem" th:if="${pb.pages-3>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+3}]])"
                                                                           href="javascript:void(0);"
                                                                           th:text="${pb.pageNum+3}">5</a></li>
                <li class="paginItem more" th:if="${pb.pages-5>=pb.pageNum}"><a href="javascript:void(0);">...</a></li>
                <li class="paginItem" th:if="${pb.pages-4>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pages}]])"
                                                                           href="javascript:void(0);"
                                                                           th:text="${pb.pages}">10</a></li>

                <li class="paginItem">
                    <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${pb.isLastPage?pb.pages:pb.pageNum+1}]])">
                        <span th:class="${pb.isLastPage?'pagepre roate ':'pagenxt '}"></span>
                    </a>
                </li>
            </ul>
        </div>
    </form>
</div>
<script type="text/javascript">
    // 表单提交
    function query() {
        $("form[name='conditionForm']").submit();
    }


    // 页面跳转
    function tiaoZhuan(num) {
        var cname = $("input[name=cname]").val();
        var brandNmae = $("input[name=brandNmae]").val();
        var typeName = $("input[name=typeName]").val();
        var proName = $("input[name=proName]").val();
        console.log(num);

        location.href = "/erp/kcWarehouse/lists?pageno=" + num + "&cname=" + cname + "&brandNmae=" + brandNmae + "&typeName=" + typeName + "&proName=" + proName;
    }


    $('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
